﻿using System;
using System.Reflection;

using Ninject.Core;


using BlueSky.Web.IoC;

namespace BlueSky.Web.IoC.Ninject
{
    /// <summary>
    /// Ninject kernel conteiner class.
    /// </summary>
    public class NinjectContainer : IIoCContainer
    {  
        private IDependencyResolver _resolver = new NinjectResolver();
        public IDependencyResolver Resolver
        {
            get { return _resolver; }
        }

        public NinjectContainer(params IModule[] config)
        {
            NinjectKernel.Initialize(config);
        }

        public void Dispose()
        {
            NinjectKernel.Dispose();
        }

        
        private IBinder _binder = new NinjectBinder();

        public IBinder Binder
        {
            get {return _binder; }
        }
    }
}
